﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Text;

#endregion

namespace MetaHeuristics.Collections
{
    public static class IntCollection
    {
        public static int[] Linear(int count)
        {
            int[] ic = new int[count];
            for (int i = 0; i < count; ++i)
                ic[i] = i;
            return ic;
        }

        public static void RandomPermutation(Random random, int[] r)
        { 
            int  i, help, node, tot_assigned = 0;

            for ( i = 0 ; i < r.Length ; i++ ) 
            {
                node  = random.Next(r.Length - tot_assigned);
                help = r[i];
                r[i] = r[i+node];
                r[i+node] = help;
                tot_assigned++;
            }
        }
    }
}
